package com.woniuxy.usercoachassemble.service;

import com.woniuxy.usercoachassemble.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author Lucas
 * @since 2020-07-09
 */
public interface UserService extends IService<User> {

    /**
     * @description:TODO(根据根据邮箱查询user表)
     * @param email 邮箱
     * @return:  com.woniuxy.usercoachassemble.entity.User
     * @author: Fy浪迹、
     * @date: 2020/7/9 16:49
     */
    public User selectUserByEmail(String email);

    /**
     * @description:TODO(根据邮箱注册用户)
     * @param user 1.email 2.password 3 role==2
     * @return:  com.woniuxy.usercoachassemble.entity.User
     * @author: Fy浪迹、
     * @date: 2020/7/9 17:19
     */
    User registerByEmail(User user);

    /**
     * @description:TODO(根据用户id查询用户)
     * @param userId
     * @return:  com.woniuxy.usercoachassemble.entity.User
     * @author: Fy浪迹、
     * @date: 2020/7/9 19:23
     */
    User selectUserById(Integer userId);

    /**
     * @description:TODO(根据用户id修改账号状态)
     * @param userId
     * @param status
     * @return:  int
     * @author: Fy浪迹、
     * @date: 2020/7/10 11:19
     */
    int updateUserStatusById(Integer userId, int status);

    /**
     * @description:TODO(根据电话号码获取user)
     * @param tel
     * @return:  com.woniuxy.usercoachassemble.entity.User
     * @author: Fy浪迹、
     * @date: 2020/7/10 11:19
     */
    User selectUserByTel(String tel);

    /**
     * @description:TODO(根据电话、角色注册)
     * @param tel
     * @param role
     * @return:  com.woniuxy.usercoachassemble.entity.User
     * @author: Fy浪迹、
     * @date: 2020/7/10 17:32
     */
    User registerByTel(String tel,Integer role);
    /**
     * @description:TODO(根据电话、角色、密码注册)
     * @param tel
     * @param role
     * @return:  com.woniuxy.usercoachassemble.entity.User
     * @author: Fy浪迹、
     * @date: 2020/7/10 17:32
     */
    User registerByTelAndPassword(String tel,Integer role,String password);

    /**
     * @description:TODO(根据电话号码修改密码)
     * @param tel
     * @param password
     * @return:  com.woniuxy.usercoachassemble.entity.User
     * @author: Fy浪迹、
     * @date: 2020/7/10 17:30
     */
    User updatePasswordByTel(String tel, String password);

    /**
     * @description:TODO(根据邮箱修改面)
     * @param email 邮箱
     * @param password 密码
     * @return:  int
     * @author: Fy浪迹、
     * @date: 2020/7/13 10:36
     */
    int updatePasswordByEmail(String email, String password);

    /**
     * @description:TODO(根据用户名查询user)
     * @param username
     * @return:  com.woniuxy.usercoachassemble.entity.User
     * @author: Fy浪迹、
     * @date: 2020/7/13 15:28
     */
    User selectUserByUsername(String username);

    Map<String, Object> selectUserMoreById(int userId);
}
